package com.xomily;

import com.xomily.web.core.config.RateLimitFilter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;

/**
 * @version V1.0
 * @ClassName:XomilyDevopsServerApplication.java
 * @author: xomily (2327742507@qq.com)
 * @date: 2021年12月17日
 * @Description: 启动程序
 * @Copyright: 2021-2022 www.xomily.com. All rights reserved.
 */
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
@EnableScheduling
@ComponentScan(basePackages = {"com.xomily.web.core.config","com.xomily"})
public class XomilyDevopsServerApplication {


    public static void main(String[] args) {
        // System.setProperty("spring.devtools.restart.enabled", "false");
        SpringApplication.run(XomilyDevopsServerApplication.class, args);
        System.out.println(" *******************  ");
        System.out.println(" 网络安全运维启动成功  ");
        System.out.println(" *******************  ");

    }

//    @Bean
    public TaskScheduler taskScheduler() {
        ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
        taskScheduler.setPoolSize(10);
        return taskScheduler;
    }

    @Bean
    public RateLimitFilter rateLimitFilter() {
        return new RateLimitFilter();
    }

}
